package indoor.nexd.com.nexdmap.listener;

import android.view.View;
import android.widget.AdapterView;

/**
 * Created by xun on 2016/3/23.
 */
public abstract class NoDoubleOnItemClickListener implements AdapterView.OnItemClickListener {
    private static final long DELAY = 1000;
    public long lastClickTime = 0;

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        long currenttime = System.currentTimeMillis();
        if (currenttime - lastClickTime > DELAY) {
            lastClickTime = currenttime;
            NoDoubleOnItemClick();
        } else {

        }
    }

    protected abstract void NoDoubleOnItemClick();
}
